<?php declare(strict_types=1);

namespace App\Enums;

use BenSampo\Enum\Enum;
use BenSampo\Enum\Exceptions\InvalidEnumMemberException;

/**
 * @method static static OptionOne()
 * @method static static OptionTwo()
 * @method static static OptionThree()
 */
final class PayMethod extends Enum
{
    //支付方式:0=支付宝,1=微信
    const ALI = 0;
    const WECHAT = 1;


    /**
     * @param mixed $value
     * @return string
     * @throws InvalidEnumMemberException
     */
    public static function getDescription(mixed $value): string
    {
        return match ($value) {
            self::ALI => '支付宝',
            self::WECHAT => '微信',
            default => self::getKey($value),
        };
    }
}
